﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 02 November 2012 16:44:35
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Data;
using System.Xml.Serialization;
using NetDon.OA.Data;
using NetDon.OA.Data.FactoryClasses;
using NetDon.OA.Data.DaoClasses;
using NetDon.OA.Data.RelationClasses;
using NetDon.OA.Data.HelperClasses;
using NetDon.OA.Data.CollectionClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.OA.Data.EntityClasses
{
	
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END

	/// <summary>
	/// Entity class which represents the entity 'IssuingOrder'. <br/><br/>
	/// 
	/// </summary>
	[Serializable]
	public partial class IssuingOrderEntity : CommonEntityBase, ISerializable
		// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
		// __LLBLGENPRO_USER_CODE_REGION_END	
	{
		#region Class Member Declarations
		private NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection	_issuingOrderDelivery;
		private bool	_alwaysFetchIssuingOrderDelivery, _alreadyFetchedIssuingOrderDelivery;
		private NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection	_issuingOrderOnWayTrack;
		private bool	_alwaysFetchIssuingOrderOnWayTrack, _alreadyFetchedIssuingOrderOnWayTrack;
		private NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection	_issuingOrderReceiptInfoTrack;
		private bool	_alwaysFetchIssuingOrderReceiptInfoTrack, _alreadyFetchedIssuingOrderReceiptInfoTrack;
		private NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection	_issuingOrderVehicleInfo;
		private bool	_alwaysFetchIssuingOrderVehicleInfo, _alreadyFetchedIssuingOrderVehicleInfo;
		private NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection	_machineAccountIncome;
		private bool	_alwaysFetchMachineAccountIncome, _alreadyFetchedMachineAccountIncome;
		private NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection	_machineAccountPayment;
		private bool	_alwaysFetchMachineAccountPayment, _alreadyFetchedMachineAccountPayment;
		private NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection	_revenueMachineAccount;
		private bool	_alwaysFetchRevenueMachineAccount, _alreadyFetchedRevenueMachineAccount;
		private NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection _issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack;
		private bool	_alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack, _alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack;
		private NetDon.OA.Data.CollectionClasses.VehicleModelCollection _vehicleModelCollectionViaIssuingOrderVehicleInfo;
		private bool	_alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo, _alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo;
		private CustomerInfoEntity _customerInfo;
		private bool	_alwaysFetchCustomerInfo, _alreadyFetchedCustomerInfo, _customerInfoReturnsNewIfNotFound;

		
		// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Statics
		private static Dictionary<string, string>	_customProperties;
		private static Dictionary<string, Dictionary<string, string>>	_fieldsCustomProperties;

		/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
		public static partial class MemberNames
		{
			/// <summary>Member name CustomerInfo</summary>
			public static readonly string CustomerInfo = "CustomerInfo";
			/// <summary>Member name IssuingOrderDelivery</summary>
			public static readonly string IssuingOrderDelivery = "IssuingOrderDelivery";
			/// <summary>Member name IssuingOrderOnWayTrack</summary>
			public static readonly string IssuingOrderOnWayTrack = "IssuingOrderOnWayTrack";
			/// <summary>Member name IssuingOrderReceiptInfoTrack</summary>
			public static readonly string IssuingOrderReceiptInfoTrack = "IssuingOrderReceiptInfoTrack";
			/// <summary>Member name IssuingOrderVehicleInfo</summary>
			public static readonly string IssuingOrderVehicleInfo = "IssuingOrderVehicleInfo";
			/// <summary>Member name MachineAccountIncome</summary>
			public static readonly string MachineAccountIncome = "MachineAccountIncome";
			/// <summary>Member name MachineAccountPayment</summary>
			public static readonly string MachineAccountPayment = "MachineAccountPayment";
			/// <summary>Member name RevenueMachineAccount</summary>
			public static readonly string RevenueMachineAccount = "RevenueMachineAccount";
			/// <summary>Member name IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack</summary>
			public static readonly string IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = "IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack";
			/// <summary>Member name VehicleModelCollectionViaIssuingOrderVehicleInfo</summary>
			public static readonly string VehicleModelCollectionViaIssuingOrderVehicleInfo = "VehicleModelCollectionViaIssuingOrderVehicleInfo";

		}
		#endregion
		
		/// <summary>Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
		static IssuingOrderEntity()
		{
			SetupCustomPropertyHashtables();
		}

		/// <summary>CTor</summary>
		public IssuingOrderEntity()
		{
			InitClassEmpty(null);
		}


		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		public IssuingOrderEntity(System.Guid id)
		{
			InitClassFetch(id, null, null);
		}

		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		public IssuingOrderEntity(System.Guid id, IPrefetchPath prefetchPathToUse)
		{
			InitClassFetch(id, null, prefetchPathToUse);
		}

		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="validator">The custom validator object for this IssuingOrderEntity</param>
		public IssuingOrderEntity(System.Guid id, IValidator validator)
		{
			InitClassFetch(id, validator, null);
		}


		/// <summary>Private CTor for deserialization</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		protected IssuingOrderEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			_issuingOrderDelivery = (NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection)info.GetValue("_issuingOrderDelivery", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection));
			_alwaysFetchIssuingOrderDelivery = info.GetBoolean("_alwaysFetchIssuingOrderDelivery");
			_alreadyFetchedIssuingOrderDelivery = info.GetBoolean("_alreadyFetchedIssuingOrderDelivery");
			_issuingOrderOnWayTrack = (NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection)info.GetValue("_issuingOrderOnWayTrack", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection));
			_alwaysFetchIssuingOrderOnWayTrack = info.GetBoolean("_alwaysFetchIssuingOrderOnWayTrack");
			_alreadyFetchedIssuingOrderOnWayTrack = info.GetBoolean("_alreadyFetchedIssuingOrderOnWayTrack");
			_issuingOrderReceiptInfoTrack = (NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection)info.GetValue("_issuingOrderReceiptInfoTrack", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection));
			_alwaysFetchIssuingOrderReceiptInfoTrack = info.GetBoolean("_alwaysFetchIssuingOrderReceiptInfoTrack");
			_alreadyFetchedIssuingOrderReceiptInfoTrack = info.GetBoolean("_alreadyFetchedIssuingOrderReceiptInfoTrack");
			_issuingOrderVehicleInfo = (NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection)info.GetValue("_issuingOrderVehicleInfo", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection));
			_alwaysFetchIssuingOrderVehicleInfo = info.GetBoolean("_alwaysFetchIssuingOrderVehicleInfo");
			_alreadyFetchedIssuingOrderVehicleInfo = info.GetBoolean("_alreadyFetchedIssuingOrderVehicleInfo");
			_machineAccountIncome = (NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection)info.GetValue("_machineAccountIncome", typeof(NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection));
			_alwaysFetchMachineAccountIncome = info.GetBoolean("_alwaysFetchMachineAccountIncome");
			_alreadyFetchedMachineAccountIncome = info.GetBoolean("_alreadyFetchedMachineAccountIncome");
			_machineAccountPayment = (NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection)info.GetValue("_machineAccountPayment", typeof(NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection));
			_alwaysFetchMachineAccountPayment = info.GetBoolean("_alwaysFetchMachineAccountPayment");
			_alreadyFetchedMachineAccountPayment = info.GetBoolean("_alreadyFetchedMachineAccountPayment");
			_revenueMachineAccount = (NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection)info.GetValue("_revenueMachineAccount", typeof(NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection));
			_alwaysFetchRevenueMachineAccount = info.GetBoolean("_alwaysFetchRevenueMachineAccount");
			_alreadyFetchedRevenueMachineAccount = info.GetBoolean("_alreadyFetchedRevenueMachineAccount");
			_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = (NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection)info.GetValue("_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection));
			_alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = info.GetBoolean("_alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack");
			_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = info.GetBoolean("_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack");
			_vehicleModelCollectionViaIssuingOrderVehicleInfo = (NetDon.OA.Data.CollectionClasses.VehicleModelCollection)info.GetValue("_vehicleModelCollectionViaIssuingOrderVehicleInfo", typeof(NetDon.OA.Data.CollectionClasses.VehicleModelCollection));
			_alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo = info.GetBoolean("_alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo");
			_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = info.GetBoolean("_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo");
			_customerInfo = (CustomerInfoEntity)info.GetValue("_customerInfo", typeof(CustomerInfoEntity));
			if(_customerInfo!=null)
			{
				_customerInfo.AfterSave+=new EventHandler(OnEntityAfterSave);
			}
			_customerInfoReturnsNewIfNotFound = info.GetBoolean("_customerInfoReturnsNewIfNotFound");
			_alwaysFetchCustomerInfo = info.GetBoolean("_alwaysFetchCustomerInfo");
			_alreadyFetchedCustomerInfo = info.GetBoolean("_alreadyFetchedCustomerInfo");

			base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance());
			
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}

		
		/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
		/// <param name="fieldIndex">The fieldindex.</param>
		protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
		{
			switch((IssuingOrderFieldIndex)fieldIndex)
			{
				case IssuingOrderFieldIndex.CustomerId:
					DesetupSyncCustomerInfo(true, false);
					_alreadyFetchedCustomerInfo = false;
					break;
				default:
					base.PerformDesyncSetupFKFieldChange(fieldIndex);
					break;
			}
		}
		
		/// <summary>Gets the inheritance info provider instance of the project this entity instance is located in. </summary>
		/// <returns>ready to use inheritance info provider instance.</returns>
		protected override IInheritanceInfoProvider GetInheritanceInfoProvider()
		{
			return InheritanceInfoProviderSingleton.GetInstance();
		}
		
		/// <summary> Will perform post-ReadXml actions</summary>
		protected override void PostReadXmlFixups()
		{
			_alreadyFetchedIssuingOrderDelivery = (_issuingOrderDelivery.Count > 0);
			_alreadyFetchedIssuingOrderOnWayTrack = (_issuingOrderOnWayTrack.Count > 0);
			_alreadyFetchedIssuingOrderReceiptInfoTrack = (_issuingOrderReceiptInfoTrack.Count > 0);
			_alreadyFetchedIssuingOrderVehicleInfo = (_issuingOrderVehicleInfo.Count > 0);
			_alreadyFetchedMachineAccountIncome = (_machineAccountIncome.Count > 0);
			_alreadyFetchedMachineAccountPayment = (_machineAccountPayment.Count > 0);
			_alreadyFetchedRevenueMachineAccount = (_revenueMachineAccount.Count > 0);
			_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = (_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.Count > 0);
			_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = (_vehicleModelCollectionViaIssuingOrderVehicleInfo.Count > 0);
			_alreadyFetchedCustomerInfo = (_customerInfo != null);

		}
				
		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		public override RelationCollection GetRelationsForFieldOfType(string fieldName)
		{
			return IssuingOrderEntity.GetRelationsForField(fieldName);
		}

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		public static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "CustomerInfo":
					toReturn.Add(IssuingOrderEntity.Relations.CustomerInfoEntityUsingCustomerId);
					break;
				case "IssuingOrderDelivery":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderDeliveryEntityUsingIssuingOrderId);
					break;
				case "IssuingOrderOnWayTrack":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderOnWayTrackEntityUsingIssuingOrderId);
					break;
				case "IssuingOrderReceiptInfoTrack":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderId);
					break;
				case "IssuingOrderVehicleInfo":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderVehicleInfoEntityUsingIssuingOrderId);
					break;
				case "MachineAccountIncome":
					toReturn.Add(IssuingOrderEntity.Relations.MachineAccountIncomeEntityUsingIssuingOrderId);
					break;
				case "MachineAccountPayment":
					toReturn.Add(IssuingOrderEntity.Relations.MachineAccountPaymentEntityUsingIssuingOrderId);
					break;
				case "RevenueMachineAccount":
					toReturn.Add(IssuingOrderEntity.Relations.RevenueMachineAccountEntityUsingIssuingOrderId);
					break;
				case "IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderId, "IssuingOrderEntity__", "IssuingOrderReceiptInfoTrack_", JoinHint.None);
					toReturn.Add(IssuingOrderReceiptInfoTrackEntity.Relations.IssuingOrderDeliveryEntityUsingIssuingOrderDeliveryId, "IssuingOrderReceiptInfoTrack_", string.Empty, JoinHint.None);
					break;
				case "VehicleModelCollectionViaIssuingOrderVehicleInfo":
					toReturn.Add(IssuingOrderEntity.Relations.IssuingOrderVehicleInfoEntityUsingIssuingOrderId, "IssuingOrderEntity__", "IssuingOrderVehicleInfo_", JoinHint.None);
					toReturn.Add(IssuingOrderVehicleInfoEntity.Relations.VehicleModelEntityUsingVechicleModel, "IssuingOrderVehicleInfo_", string.Empty, JoinHint.None);
					break;

				default:

					break;				
			}
			return toReturn;
		}



		/// <summary> ISerializable member. Does custom serialization so event handlers do not get serialized.
		/// Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.AddValue("_issuingOrderDelivery", (!this.MarkedForDeletion?_issuingOrderDelivery:null));
			info.AddValue("_alwaysFetchIssuingOrderDelivery", _alwaysFetchIssuingOrderDelivery);
			info.AddValue("_alreadyFetchedIssuingOrderDelivery", _alreadyFetchedIssuingOrderDelivery);
			info.AddValue("_issuingOrderOnWayTrack", (!this.MarkedForDeletion?_issuingOrderOnWayTrack:null));
			info.AddValue("_alwaysFetchIssuingOrderOnWayTrack", _alwaysFetchIssuingOrderOnWayTrack);
			info.AddValue("_alreadyFetchedIssuingOrderOnWayTrack", _alreadyFetchedIssuingOrderOnWayTrack);
			info.AddValue("_issuingOrderReceiptInfoTrack", (!this.MarkedForDeletion?_issuingOrderReceiptInfoTrack:null));
			info.AddValue("_alwaysFetchIssuingOrderReceiptInfoTrack", _alwaysFetchIssuingOrderReceiptInfoTrack);
			info.AddValue("_alreadyFetchedIssuingOrderReceiptInfoTrack", _alreadyFetchedIssuingOrderReceiptInfoTrack);
			info.AddValue("_issuingOrderVehicleInfo", (!this.MarkedForDeletion?_issuingOrderVehicleInfo:null));
			info.AddValue("_alwaysFetchIssuingOrderVehicleInfo", _alwaysFetchIssuingOrderVehicleInfo);
			info.AddValue("_alreadyFetchedIssuingOrderVehicleInfo", _alreadyFetchedIssuingOrderVehicleInfo);
			info.AddValue("_machineAccountIncome", (!this.MarkedForDeletion?_machineAccountIncome:null));
			info.AddValue("_alwaysFetchMachineAccountIncome", _alwaysFetchMachineAccountIncome);
			info.AddValue("_alreadyFetchedMachineAccountIncome", _alreadyFetchedMachineAccountIncome);
			info.AddValue("_machineAccountPayment", (!this.MarkedForDeletion?_machineAccountPayment:null));
			info.AddValue("_alwaysFetchMachineAccountPayment", _alwaysFetchMachineAccountPayment);
			info.AddValue("_alreadyFetchedMachineAccountPayment", _alreadyFetchedMachineAccountPayment);
			info.AddValue("_revenueMachineAccount", (!this.MarkedForDeletion?_revenueMachineAccount:null));
			info.AddValue("_alwaysFetchRevenueMachineAccount", _alwaysFetchRevenueMachineAccount);
			info.AddValue("_alreadyFetchedRevenueMachineAccount", _alreadyFetchedRevenueMachineAccount);
			info.AddValue("_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", (!this.MarkedForDeletion?_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack:null));
			info.AddValue("_alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", _alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack);
			info.AddValue("_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", _alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack);
			info.AddValue("_vehicleModelCollectionViaIssuingOrderVehicleInfo", (!this.MarkedForDeletion?_vehicleModelCollectionViaIssuingOrderVehicleInfo:null));
			info.AddValue("_alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo", _alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo);
			info.AddValue("_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo", _alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo);
			info.AddValue("_customerInfo", (!this.MarkedForDeletion?_customerInfo:null));
			info.AddValue("_customerInfoReturnsNewIfNotFound", _customerInfoReturnsNewIfNotFound);
			info.AddValue("_alwaysFetchCustomerInfo", _alwaysFetchCustomerInfo);
			info.AddValue("_alreadyFetchedCustomerInfo", _alreadyFetchedCustomerInfo);

			
			// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
			// __LLBLGENPRO_USER_CODE_REGION_END
			base.GetObjectData(info, context);
		}
		
		/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
		/// <param name="propertyName">Name of the property.</param>
		/// <param name="entity">Entity to set as an related entity</param>
		/// <remarks>Used by prefetch path logic.</remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void SetRelatedEntityProperty(string propertyName, IEntity entity)
		{
			switch(propertyName)
			{
				case "CustomerInfo":
					_alreadyFetchedCustomerInfo = true;
					this.CustomerInfo = (CustomerInfoEntity)entity;
					break;
				case "IssuingOrderDelivery":
					_alreadyFetchedIssuingOrderDelivery = true;
					if(entity!=null)
					{
						this.IssuingOrderDelivery.Add((IssuingOrderDeliveryEntity)entity);
					}
					break;
				case "IssuingOrderOnWayTrack":
					_alreadyFetchedIssuingOrderOnWayTrack = true;
					if(entity!=null)
					{
						this.IssuingOrderOnWayTrack.Add((IssuingOrderOnWayTrackEntity)entity);
					}
					break;
				case "IssuingOrderReceiptInfoTrack":
					_alreadyFetchedIssuingOrderReceiptInfoTrack = true;
					if(entity!=null)
					{
						this.IssuingOrderReceiptInfoTrack.Add((IssuingOrderReceiptInfoTrackEntity)entity);
					}
					break;
				case "IssuingOrderVehicleInfo":
					_alreadyFetchedIssuingOrderVehicleInfo = true;
					if(entity!=null)
					{
						this.IssuingOrderVehicleInfo.Add((IssuingOrderVehicleInfoEntity)entity);
					}
					break;
				case "MachineAccountIncome":
					_alreadyFetchedMachineAccountIncome = true;
					if(entity!=null)
					{
						this.MachineAccountIncome.Add((MachineAccountIncomeEntity)entity);
					}
					break;
				case "MachineAccountPayment":
					_alreadyFetchedMachineAccountPayment = true;
					if(entity!=null)
					{
						this.MachineAccountPayment.Add((MachineAccountPaymentEntity)entity);
					}
					break;
				case "RevenueMachineAccount":
					_alreadyFetchedRevenueMachineAccount = true;
					if(entity!=null)
					{
						this.RevenueMachineAccount.Add((RevenueMachineAccountEntity)entity);
					}
					break;
				case "IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack":
					_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = true;
					if(entity!=null)
					{
						this.IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.Add((IssuingOrderDeliveryEntity)entity);
					}
					break;
				case "VehicleModelCollectionViaIssuingOrderVehicleInfo":
					_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = true;
					if(entity!=null)
					{
						this.VehicleModelCollectionViaIssuingOrderVehicleInfo.Add((VehicleModelEntity)entity);
					}
					break;

				default:

					break;
			}
		}

		/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void SetRelatedEntity(IEntity relatedEntity, string fieldName)
		{
			switch(fieldName)
			{
				case "CustomerInfo":
					SetupSyncCustomerInfo(relatedEntity);
					break;
				case "IssuingOrderDelivery":
					_issuingOrderDelivery.Add((IssuingOrderDeliveryEntity)relatedEntity);
					break;
				case "IssuingOrderOnWayTrack":
					_issuingOrderOnWayTrack.Add((IssuingOrderOnWayTrackEntity)relatedEntity);
					break;
				case "IssuingOrderReceiptInfoTrack":
					_issuingOrderReceiptInfoTrack.Add((IssuingOrderReceiptInfoTrackEntity)relatedEntity);
					break;
				case "IssuingOrderVehicleInfo":
					_issuingOrderVehicleInfo.Add((IssuingOrderVehicleInfoEntity)relatedEntity);
					break;
				case "MachineAccountIncome":
					_machineAccountIncome.Add((MachineAccountIncomeEntity)relatedEntity);
					break;
				case "MachineAccountPayment":
					_machineAccountPayment.Add((MachineAccountPaymentEntity)relatedEntity);
					break;
				case "RevenueMachineAccount":
					_revenueMachineAccount.Add((RevenueMachineAccountEntity)relatedEntity);
					break;

				default:

					break;
			}
		}
		
		/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
		/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void UnsetRelatedEntity(IEntity relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
		{
			switch(fieldName)
			{
				case "CustomerInfo":
					DesetupSyncCustomerInfo(false, true);
					break;
				case "IssuingOrderDelivery":
					base.PerformRelatedEntityRemoval(_issuingOrderDelivery, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "IssuingOrderOnWayTrack":
					base.PerformRelatedEntityRemoval(_issuingOrderOnWayTrack, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "IssuingOrderReceiptInfoTrack":
					base.PerformRelatedEntityRemoval(_issuingOrderReceiptInfoTrack, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "IssuingOrderVehicleInfo":
					base.PerformRelatedEntityRemoval(_issuingOrderVehicleInfo, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "MachineAccountIncome":
					base.PerformRelatedEntityRemoval(_machineAccountIncome, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "MachineAccountPayment":
					base.PerformRelatedEntityRemoval(_machineAccountPayment, relatedEntity, signalRelatedEntityManyToOne);
					break;
				case "RevenueMachineAccount":
					base.PerformRelatedEntityRemoval(_revenueMachineAccount, relatedEntity, signalRelatedEntityManyToOne);
					break;

				default:

					break;
			}
		}

		/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These
		/// entities will have to be persisted after this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity objects, referenced by this entity</returns>
		public override List<IEntity> GetDependingRelatedEntities()
		{
			List<IEntity> toReturn = new List<IEntity>();


			return toReturn;
		}
		
		/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
		/// entities will have to be persisted before this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity objects, referenced by this entity</returns>
		public override List<IEntity> GetDependentRelatedEntities()
		{
			List<IEntity> toReturn = new List<IEntity>();
			if(_customerInfo!=null)
			{
				toReturn.Add(_customerInfo);
			}


			return toReturn;
		}
		
		/// <summary> Gets a List of all entity collections stored as member variables in this entity. The contents of the ArrayList is
		/// used by the DataAccessAdapter to perform recursive saves. Only 1:n related collections are returned.</summary>
		/// <returns>Collection with 0 or more IEntityCollection objects, referenced by this entity</returns>
		public override List<IEntityCollection> GetMemberEntityCollections()
		{
			List<IEntityCollection> toReturn = new List<IEntityCollection>();
			toReturn.Add(_issuingOrderDelivery);
			toReturn.Add(_issuingOrderOnWayTrack);
			toReturn.Add(_issuingOrderReceiptInfoTrack);
			toReturn.Add(_issuingOrderVehicleInfo);
			toReturn.Add(_machineAccountIncome);
			toReturn.Add(_machineAccountPayment);
			toReturn.Add(_revenueMachineAccount);

			return toReturn;
		}

		

		

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id)
		{
			return FetchUsingPK(id, null, null, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse)
		{
			return FetchUsingPK(id, prefetchPathToUse, null, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse)
		{
			return Fetch(id, prefetchPathToUse, contextToUse, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <param name="excludedIncludedFields">The list of IEntityField objects which have to be excluded or included for the fetch. 
		/// If null or empty, all fields are fetched (default). If an instance of ExcludeIncludeFieldsList is passed in and its ExcludeContainedFields property
		/// is set to false, the fields contained in excludedIncludedFields are kept in the query, the rest of the fields in the query are excluded.</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
		{
			return Fetch(id, prefetchPathToUse, contextToUse, excludedIncludedFields);
		}

		/// <summary> Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked "Out-of-sync", due to a save action. 
		/// Refetching an empty Entity has no effect. </summary>
		/// <returns>true if Refetch succeeded, false otherwise</returns>
		public override bool Refetch()
		{
			return Fetch(this.Id, null, null, null);
		}

		/// <summary> Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise.
		/// Should not be used for testing if the current value is NULL, use <see cref="TestCurrentFieldValueForNull"/> for that.</summary>
		/// <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param>
		/// <returns>true if the field with the passed in index was NULL in the persistent storage, false otherwise</returns>
		public bool TestOriginalFieldValueForNull(IssuingOrderFieldIndex fieldIndex)
		{
			return base.Fields[(int)fieldIndex].IsNull;
		}
		
		/// <summary>Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise.
		/// Should not be used for testing if the original value (read from the db) is NULL</summary>
		/// <param name="fieldIndex">Index of the field to test if its currentvalue is null/undefined</param>
		/// <returns>true if the field's value isn't defined yet, false otherwise</returns>
		public bool TestCurrentFieldValueForNull(IssuingOrderFieldIndex fieldIndex)
		{
			return base.CheckIfCurrentFieldValueIsNull((int)fieldIndex);
		}

				
		/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
		/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
		public override List<IEntityRelation> GetAllRelations()
		{
			return new IssuingOrderRelations().GetAllRelations();
		}


		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderDeliveryEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDelivery(bool forceFetch)
		{
			return GetMultiIssuingOrderDelivery(forceFetch, _issuingOrderDelivery.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderDeliveryEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDelivery(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiIssuingOrderDelivery(forceFetch, _issuingOrderDelivery.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDelivery(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiIssuingOrderDelivery(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDelivery(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedIssuingOrderDelivery || forceFetch || _alwaysFetchIssuingOrderDelivery) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderDelivery.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderDelivery);
					}
				}
				_issuingOrderDelivery.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderDelivery.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderDelivery.GetMultiManyToOne(this, filter);
				_issuingOrderDelivery.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderDelivery = true;
			}
			return _issuingOrderDelivery;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderDelivery'. These settings will be taken into account
		/// when the property IssuingOrderDelivery is requested or GetMultiIssuingOrderDelivery is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderDelivery(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderDelivery.SortClauses=sortClauses;
			_issuingOrderDelivery.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderOnWayTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderOnWayTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection GetMultiIssuingOrderOnWayTrack(bool forceFetch)
		{
			return GetMultiIssuingOrderOnWayTrack(forceFetch, _issuingOrderOnWayTrack.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderOnWayTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderOnWayTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection GetMultiIssuingOrderOnWayTrack(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiIssuingOrderOnWayTrack(forceFetch, _issuingOrderOnWayTrack.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderOnWayTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection GetMultiIssuingOrderOnWayTrack(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiIssuingOrderOnWayTrack(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderOnWayTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection GetMultiIssuingOrderOnWayTrack(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedIssuingOrderOnWayTrack || forceFetch || _alwaysFetchIssuingOrderOnWayTrack) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderOnWayTrack.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderOnWayTrack);
					}
				}
				_issuingOrderOnWayTrack.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderOnWayTrack.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderOnWayTrack.GetMultiManyToOne(this, filter);
				_issuingOrderOnWayTrack.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderOnWayTrack = true;
			}
			return _issuingOrderOnWayTrack;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderOnWayTrack'. These settings will be taken into account
		/// when the property IssuingOrderOnWayTrack is requested or GetMultiIssuingOrderOnWayTrack is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderOnWayTrack(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderOnWayTrack.SortClauses=sortClauses;
			_issuingOrderOnWayTrack.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderReceiptInfoTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderReceiptInfoTrack.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderReceiptInfoTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderReceiptInfoTrack.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedIssuingOrderReceiptInfoTrack || forceFetch || _alwaysFetchIssuingOrderReceiptInfoTrack) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderReceiptInfoTrack.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderReceiptInfoTrack);
					}
				}
				_issuingOrderReceiptInfoTrack.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderReceiptInfoTrack.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderReceiptInfoTrack.GetMultiManyToOne(this, null, filter);
				_issuingOrderReceiptInfoTrack.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderReceiptInfoTrack = true;
			}
			return _issuingOrderReceiptInfoTrack;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderReceiptInfoTrack'. These settings will be taken into account
		/// when the property IssuingOrderReceiptInfoTrack is requested or GetMultiIssuingOrderReceiptInfoTrack is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderReceiptInfoTrack(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderReceiptInfoTrack.SortClauses=sortClauses;
			_issuingOrderReceiptInfoTrack.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderVehicleInfoEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderVehicleInfoEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection GetMultiIssuingOrderVehicleInfo(bool forceFetch)
		{
			return GetMultiIssuingOrderVehicleInfo(forceFetch, _issuingOrderVehicleInfo.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderVehicleInfoEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderVehicleInfoEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection GetMultiIssuingOrderVehicleInfo(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiIssuingOrderVehicleInfo(forceFetch, _issuingOrderVehicleInfo.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderVehicleInfoEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection GetMultiIssuingOrderVehicleInfo(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiIssuingOrderVehicleInfo(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderVehicleInfoEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection GetMultiIssuingOrderVehicleInfo(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedIssuingOrderVehicleInfo || forceFetch || _alwaysFetchIssuingOrderVehicleInfo) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderVehicleInfo.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderVehicleInfo);
					}
				}
				_issuingOrderVehicleInfo.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderVehicleInfo.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderVehicleInfo.GetMultiManyToOne(this, null, filter);
				_issuingOrderVehicleInfo.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderVehicleInfo = true;
			}
			return _issuingOrderVehicleInfo;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderVehicleInfo'. These settings will be taken into account
		/// when the property IssuingOrderVehicleInfo is requested or GetMultiIssuingOrderVehicleInfo is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderVehicleInfo(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderVehicleInfo.SortClauses=sortClauses;
			_issuingOrderVehicleInfo.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountIncomeEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'MachineAccountIncomeEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection GetMultiMachineAccountIncome(bool forceFetch)
		{
			return GetMultiMachineAccountIncome(forceFetch, _machineAccountIncome.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountIncomeEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'MachineAccountIncomeEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection GetMultiMachineAccountIncome(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiMachineAccountIncome(forceFetch, _machineAccountIncome.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountIncomeEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection GetMultiMachineAccountIncome(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiMachineAccountIncome(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountIncomeEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection GetMultiMachineAccountIncome(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedMachineAccountIncome || forceFetch || _alwaysFetchMachineAccountIncome) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_machineAccountIncome.ParticipatesInTransaction)
					{
						base.Transaction.Add(_machineAccountIncome);
					}
				}
				_machineAccountIncome.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_machineAccountIncome.EntityFactoryToUse = entityFactoryToUse;
				}
				_machineAccountIncome.GetMultiManyToOne(this, filter);
				_machineAccountIncome.SuppressClearInGetMulti=false;
				_alreadyFetchedMachineAccountIncome = true;
			}
			return _machineAccountIncome;
		}

		/// <summary> Sets the collection parameters for the collection for 'MachineAccountIncome'. These settings will be taken into account
		/// when the property MachineAccountIncome is requested or GetMultiMachineAccountIncome is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersMachineAccountIncome(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_machineAccountIncome.SortClauses=sortClauses;
			_machineAccountIncome.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountPaymentEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'MachineAccountPaymentEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection GetMultiMachineAccountPayment(bool forceFetch)
		{
			return GetMultiMachineAccountPayment(forceFetch, _machineAccountPayment.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountPaymentEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'MachineAccountPaymentEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection GetMultiMachineAccountPayment(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiMachineAccountPayment(forceFetch, _machineAccountPayment.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountPaymentEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection GetMultiMachineAccountPayment(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiMachineAccountPayment(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'MachineAccountPaymentEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection GetMultiMachineAccountPayment(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedMachineAccountPayment || forceFetch || _alwaysFetchMachineAccountPayment) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_machineAccountPayment.ParticipatesInTransaction)
					{
						base.Transaction.Add(_machineAccountPayment);
					}
				}
				_machineAccountPayment.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_machineAccountPayment.EntityFactoryToUse = entityFactoryToUse;
				}
				_machineAccountPayment.GetMultiManyToOne(this, filter);
				_machineAccountPayment.SuppressClearInGetMulti=false;
				_alreadyFetchedMachineAccountPayment = true;
			}
			return _machineAccountPayment;
		}

		/// <summary> Sets the collection parameters for the collection for 'MachineAccountPayment'. These settings will be taken into account
		/// when the property MachineAccountPayment is requested or GetMultiMachineAccountPayment is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersMachineAccountPayment(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_machineAccountPayment.SortClauses=sortClauses;
			_machineAccountPayment.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'RevenueMachineAccountEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'RevenueMachineAccountEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection GetMultiRevenueMachineAccount(bool forceFetch)
		{
			return GetMultiRevenueMachineAccount(forceFetch, _revenueMachineAccount.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'RevenueMachineAccountEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'RevenueMachineAccountEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection GetMultiRevenueMachineAccount(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiRevenueMachineAccount(forceFetch, _revenueMachineAccount.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'RevenueMachineAccountEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection GetMultiRevenueMachineAccount(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiRevenueMachineAccount(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'RevenueMachineAccountEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection GetMultiRevenueMachineAccount(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedRevenueMachineAccount || forceFetch || _alwaysFetchRevenueMachineAccount) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_revenueMachineAccount.ParticipatesInTransaction)
					{
						base.Transaction.Add(_revenueMachineAccount);
					}
				}
				_revenueMachineAccount.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_revenueMachineAccount.EntityFactoryToUse = entityFactoryToUse;
				}
				_revenueMachineAccount.GetMultiManyToOne(this, filter);
				_revenueMachineAccount.SuppressClearInGetMulti=false;
				_alreadyFetchedRevenueMachineAccount = true;
			}
			return _revenueMachineAccount;
		}

		/// <summary> Sets the collection parameters for the collection for 'RevenueMachineAccount'. These settings will be taken into account
		/// when the property RevenueMachineAccount is requested or GetMultiRevenueMachineAccount is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersRevenueMachineAccount(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_revenueMachineAccount.SortClauses=sortClauses;
			_revenueMachineAccount.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderDeliveryEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(bool forceFetch)
		{
			return GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.EntityFactoryToUse);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToMany() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
 			if( ( !_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack || forceFetch || _alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack);
					}
				}
				IPredicateExpression filter = new PredicateExpression();
				filter.Add(new FieldCompareValuePredicate(IssuingOrderFields.Id, ComparisonOperator.Equal, this.Id, "IssuingOrderEntity__"));
				_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.GetMulti(filter, GetRelationsForField("IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack"));
				_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = true;
			}
			return _issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack'. These settings will be taken into account
		/// when the property IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack is requested or GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.SortClauses=sortClauses;
			_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'VehicleModelEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'VehicleModelEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.VehicleModelCollection GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo(bool forceFetch)
		{
			return GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo(forceFetch, _vehicleModelCollectionViaIssuingOrderVehicleInfo.EntityFactoryToUse);
		}

		/// <summary> Retrieves all related entities of type 'VehicleModelEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToMany() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.VehicleModelCollection GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
 			if( ( !_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo || forceFetch || _alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_vehicleModelCollectionViaIssuingOrderVehicleInfo.ParticipatesInTransaction)
					{
						base.Transaction.Add(_vehicleModelCollectionViaIssuingOrderVehicleInfo);
					}
				}
				IPredicateExpression filter = new PredicateExpression();
				filter.Add(new FieldCompareValuePredicate(IssuingOrderFields.Id, ComparisonOperator.Equal, this.Id, "IssuingOrderEntity__"));
				_vehicleModelCollectionViaIssuingOrderVehicleInfo.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_vehicleModelCollectionViaIssuingOrderVehicleInfo.EntityFactoryToUse = entityFactoryToUse;
				}
				_vehicleModelCollectionViaIssuingOrderVehicleInfo.GetMulti(filter, GetRelationsForField("VehicleModelCollectionViaIssuingOrderVehicleInfo"));
				_vehicleModelCollectionViaIssuingOrderVehicleInfo.SuppressClearInGetMulti=false;
				_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = true;
			}
			return _vehicleModelCollectionViaIssuingOrderVehicleInfo;
		}

		/// <summary> Sets the collection parameters for the collection for 'VehicleModelCollectionViaIssuingOrderVehicleInfo'. These settings will be taken into account
		/// when the property VehicleModelCollectionViaIssuingOrderVehicleInfo is requested or GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersVehicleModelCollectionViaIssuingOrderVehicleInfo(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_vehicleModelCollectionViaIssuingOrderVehicleInfo.SortClauses=sortClauses;
			_vehicleModelCollectionViaIssuingOrderVehicleInfo.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves the related entity of type 'CustomerInfoEntity', using a relation of type 'n:1'</summary>
		/// <returns>A fetched entity of type 'CustomerInfoEntity' which is related to this entity.</returns>
		public CustomerInfoEntity GetSingleCustomerInfo()
		{
			return GetSingleCustomerInfo(false);
		}

		/// <summary> Retrieves the related entity of type 'CustomerInfoEntity', using a relation of type 'n:1'</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param>
		/// <returns>A fetched entity of type 'CustomerInfoEntity' which is related to this entity.</returns>
		public virtual CustomerInfoEntity GetSingleCustomerInfo(bool forceFetch)
		{
			if( ( !_alreadyFetchedCustomerInfo || forceFetch || _alwaysFetchCustomerInfo) && !base.IsSerializing && !base.IsDeserializing  && !base.InDesignMode)			
			{
				bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(IssuingOrderEntity.Relations.CustomerInfoEntityUsingCustomerId);

				CustomerInfoEntity newEntity = new CustomerInfoEntity();
				if(base.ParticipatesInTransaction)
				{
					base.Transaction.Add(newEntity);
				}
				bool fetchResult = false;
				if(performLazyLoading)
				{
					fetchResult = newEntity.FetchUsingPK(this.CustomerId.GetValueOrDefault());
				}
				if(fetchResult)
				{
					if(base.ActiveContext!=null)
					{
						newEntity = (CustomerInfoEntity)base.ActiveContext.Get(newEntity);
					}
					this.CustomerInfo = newEntity;
				}
				else
				{
					if(_customerInfoReturnsNewIfNotFound)
					{
						if(performLazyLoading || (!performLazyLoading && (_customerInfo == null)))
						{
							this.CustomerInfo = newEntity;
						}
					}
					else
					{
						this.CustomerInfo = null;
					}
				}
				_alreadyFetchedCustomerInfo = fetchResult;
				if(base.ParticipatesInTransaction && !fetchResult)
				{
					base.Transaction.Remove(newEntity);
				}
			}
			return _customerInfo;
		}


		/// <summary> Performs the insert action of a new Entity to the persistent storage.</summary>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool InsertEntity()
		{
			IssuingOrderDAO dao = (IssuingOrderDAO)CreateDAOInstance();
			return dao.AddNew(base.Fields, base.Transaction);
		}
		
		/// <summary> Adds the internals to the active context. </summary>
		protected override void AddInternalsToContext()
		{
			_issuingOrderDelivery.ActiveContext = base.ActiveContext;
			_issuingOrderOnWayTrack.ActiveContext = base.ActiveContext;
			_issuingOrderReceiptInfoTrack.ActiveContext = base.ActiveContext;
			_issuingOrderVehicleInfo.ActiveContext = base.ActiveContext;
			_machineAccountIncome.ActiveContext = base.ActiveContext;
			_machineAccountPayment.ActiveContext = base.ActiveContext;
			_revenueMachineAccount.ActiveContext = base.ActiveContext;
			_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.ActiveContext = base.ActiveContext;
			_vehicleModelCollectionViaIssuingOrderVehicleInfo.ActiveContext = base.ActiveContext;
			if(_customerInfo!=null)
			{
				_customerInfo.ActiveContext = base.ActiveContext;
			}


		}


		/// <summary> Performs the update action of an existing Entity to the persistent storage.</summary>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool UpdateEntity()
		{
			IssuingOrderDAO dao = (IssuingOrderDAO)CreateDAOInstance();
			return dao.UpdateExisting(base.Fields, base.Transaction);
		}
		
		/// <summary> Performs the update action of an existing Entity to the persistent storage.</summary>
		/// <param name="updateRestriction">Predicate expression, meant for concurrency checks in an Update query</param>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool UpdateEntity(IPredicate updateRestriction)
		{
			IssuingOrderDAO dao = (IssuingOrderDAO)CreateDAOInstance();
			return dao.UpdateExisting(base.Fields, base.Transaction, updateRestriction);
		}
	
		/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
		/// <param name="validatorToUse">Validator to use.</param>
		protected virtual void InitClassEmpty(IValidator validatorToUse)
		{
			OnInitializing();
			base.Fields = CreateFields();
			base.IsNew=true;
			base.Validator = validatorToUse;

			InitClassMembers();
			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
			// __LLBLGENPRO_USER_CODE_REGION_END

			OnInitialized();
		}
		
		/// <summary>Creates entity fields object for this entity. Used in constructor to setup this entity in a polymorphic scenario.</summary>
		protected virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(NetDon.OA.Data.EntityType.IssuingOrderEntity);
		}
		
		/// <summary>Creates a new transaction object</summary>
		/// <param name="levelOfIsolation">The level of isolation.</param>
		/// <param name="name">The name.</param>
		protected override ITransaction CreateTransaction( IsolationLevel levelOfIsolation, string name )
		{
			return new Transaction(levelOfIsolation, name);
		}

		/// <summary>
		/// Creates the ITypeDefaultValue instance used to provide default values for value types which aren't of type nullable(of T)
		/// </summary>
		/// <returns></returns>
		protected override ITypeDefaultValue CreateTypeDefaultValueProvider()
		{
			return new TypeDefaultValue();
		}

		/// <summary>
		/// Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element. 
		/// </summary>
		/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
		public override Dictionary<string, object> GetRelatedData()
		{
			Dictionary<string, object> toReturn = new Dictionary<string, object>();
			toReturn.Add("CustomerInfo", _customerInfo);
			toReturn.Add("IssuingOrderDelivery", _issuingOrderDelivery);
			toReturn.Add("IssuingOrderOnWayTrack", _issuingOrderOnWayTrack);
			toReturn.Add("IssuingOrderReceiptInfoTrack", _issuingOrderReceiptInfoTrack);
			toReturn.Add("IssuingOrderVehicleInfo", _issuingOrderVehicleInfo);
			toReturn.Add("MachineAccountIncome", _machineAccountIncome);
			toReturn.Add("MachineAccountPayment", _machineAccountPayment);
			toReturn.Add("RevenueMachineAccount", _revenueMachineAccount);
			toReturn.Add("IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", _issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack);
			toReturn.Add("VehicleModelCollectionViaIssuingOrderVehicleInfo", _vehicleModelCollectionViaIssuingOrderVehicleInfo);

			return toReturn;
		}
		

		/// <summary> Initializes the the entity and fetches the data related to the entity in this entity.</summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="validator">The validator object for this IssuingOrderEntity</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		protected virtual void InitClassFetch(System.Guid id, IValidator validator, IPrefetchPath prefetchPathToUse)
		{
			OnInitializing();
			base.Validator = validator;
			InitClassMembers();
			base.Fields = CreateFields();
			bool wasSuccesful = Fetch(id, prefetchPathToUse, null, null);
			base.IsNew = !wasSuccesful;

			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassFetch
			// __LLBLGENPRO_USER_CODE_REGION_END

			OnInitialized();
		}

		/// <summary> Initializes the class members</summary>
		private void InitClassMembers()
		{
			_issuingOrderDelivery = new NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection(new IssuingOrderDeliveryEntityFactory());
			_issuingOrderDelivery.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchIssuingOrderDelivery = false;
			_alreadyFetchedIssuingOrderDelivery = false;
			_issuingOrderOnWayTrack = new NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection(new IssuingOrderOnWayTrackEntityFactory());
			_issuingOrderOnWayTrack.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchIssuingOrderOnWayTrack = false;
			_alreadyFetchedIssuingOrderOnWayTrack = false;
			_issuingOrderReceiptInfoTrack = new NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection(new IssuingOrderReceiptInfoTrackEntityFactory());
			_issuingOrderReceiptInfoTrack.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchIssuingOrderReceiptInfoTrack = false;
			_alreadyFetchedIssuingOrderReceiptInfoTrack = false;
			_issuingOrderVehicleInfo = new NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection(new IssuingOrderVehicleInfoEntityFactory());
			_issuingOrderVehicleInfo.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchIssuingOrderVehicleInfo = false;
			_alreadyFetchedIssuingOrderVehicleInfo = false;
			_machineAccountIncome = new NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection(new MachineAccountIncomeEntityFactory());
			_machineAccountIncome.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchMachineAccountIncome = false;
			_alreadyFetchedMachineAccountIncome = false;
			_machineAccountPayment = new NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection(new MachineAccountPaymentEntityFactory());
			_machineAccountPayment.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchMachineAccountPayment = false;
			_alreadyFetchedMachineAccountPayment = false;
			_revenueMachineAccount = new NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection(new RevenueMachineAccountEntityFactory());
			_revenueMachineAccount.SetContainingEntityInfo(this, "IssuingOrder");
			_alwaysFetchRevenueMachineAccount = false;
			_alreadyFetchedRevenueMachineAccount = false;
			_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = new NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection(new IssuingOrderDeliveryEntityFactory());
			_alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = false;
			_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = false;
			_vehicleModelCollectionViaIssuingOrderVehicleInfo = new NetDon.OA.Data.CollectionClasses.VehicleModelCollection(new VehicleModelEntityFactory());
			_alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo = false;
			_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = false;
			_customerInfo = null;
			_customerInfoReturnsNewIfNotFound = true;
			_alwaysFetchCustomerInfo = false;
			_alreadyFetchedCustomerInfo = false;


			PerformDependencyInjection();
			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
			// __LLBLGENPRO_USER_CODE_REGION_END
			OnInitClassMembersComplete();
		}

		#region Custom Property Hashtable Setup
		/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
		private static void SetupCustomPropertyHashtables()
		{
			_customProperties = new Dictionary<string, string>();
			_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();

			Dictionary<string, string> fieldHashtable = null;
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("Id", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("BusinessType", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderCode", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("GoodsShippedTypeId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("RouteTypeId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ReceivingOrderDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CustomerId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderVehicleNumber", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("TransportationPlanCode", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DeliveryProvince", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderVolumn", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderWeight", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderQuantity", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CheckoutType", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("EntruckingDetails", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("EntruckingAddress", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("PlannedShippingDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ActualShippingDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DelayedReasons", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ShuntingCost", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ShuntingPerson", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("PaymentMethod", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OnsiteOperator", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ActualEntruckingBoxAmount", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("GoodsJiltedReasons", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("IsGoodsJilted", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OnsiteEntruckingComments", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CreatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("LastUpdatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CreateBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("LastUpdatedBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderStatus", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("AreaId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ShuntingCostExceptionsComment", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("StartShippmentDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ShuntingCostExceptionComments", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("GoodsLeftBoxAmount", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DelayedDays", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("GoodsUnloadingCost", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("IsClientReturnVisit", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ClientTelephone", fieldHashtable);
		}
		#endregion


		/// <summary> Removes the sync logic for member _customerInfo</summary>
		/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
		/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
		private void DesetupSyncCustomerInfo(bool signalRelatedEntity, bool resetFKFields)
		{
			base.PerformDesetupSyncRelatedEntity( _customerInfo, new PropertyChangedEventHandler( OnCustomerInfoPropertyChanged ), "CustomerInfo", IssuingOrderEntity.Relations.CustomerInfoEntityUsingCustomerId, true, signalRelatedEntity, "IssuingOrder", resetFKFields, new int[] { (int)IssuingOrderFieldIndex.CustomerId } );		
			_customerInfo = null;
		}
		
		/// <summary> setups the sync logic for member _customerInfo</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncCustomerInfo(IEntity relatedEntity)
		{
			if(_customerInfo!=relatedEntity)
			{		
				DesetupSyncCustomerInfo(true, true);
				_customerInfo = (CustomerInfoEntity)relatedEntity;
				base.PerformSetupSyncRelatedEntity( _customerInfo, new PropertyChangedEventHandler( OnCustomerInfoPropertyChanged ), "CustomerInfo", IssuingOrderEntity.Relations.CustomerInfoEntityUsingCustomerId, true, ref _alreadyFetchedCustomerInfo, new string[] {  } );
			}
		}

		/// <summary>Handles property change events of properties in a related entity.</summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnCustomerInfoPropertyChanged( object sender, PropertyChangedEventArgs e )
		{
			switch( e.PropertyName )
			{
				default:
					break;
			}
		}


		/// <summary> Fetches the entity from the persistent storage. Fetch simply reads the entity into an EntityFields object. </summary>
		/// <param name="id">PK value for IssuingOrder which data should be fetched into this IssuingOrder object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <param name="excludedIncludedFields">The list of IEntityField objects which have to be excluded or included for the fetch. 
		/// If null or empty, all fields are fetched (default). If an instance of ExcludeIncludeFieldsList is passed in and its ExcludeContainedFields property
		/// is set to false, the fields contained in excludedIncludedFields are kept in the query, the rest of the fields in the query are excluded.</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		private bool Fetch(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
		{
			try
			{
				OnFetch();
				IDao dao = this.CreateDAOInstance();
				base.Fields[(int)IssuingOrderFieldIndex.Id].ForcedCurrentValueWrite(id);
				dao.FetchExisting(this, base.Transaction, prefetchPathToUse, contextToUse, excludedIncludedFields);
				return (base.Fields.State == EntityState.Fetched);
			}
			finally
			{
				OnFetchComplete();
			}
		}


		/// <summary> Creates the DAO instance for this type</summary>
		/// <returns></returns>
		protected override IDao CreateDAOInstance()
		{
			return DAOFactory.CreateIssuingOrderDAO();
		}
		
		/// <summary> Creates the entity factory for this type.</summary>
		/// <returns></returns>
		protected override IEntityFactory CreateEntityFactory()
		{
			return new IssuingOrderEntityFactory();
		}

		#region Class Property Declarations
		/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
		public  static IssuingOrderRelations Relations
		{
			get	{ return new IssuingOrderRelations(); }
		}
		
		/// <summary> The custom properties for this entity type.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, string> CustomProperties
		{
			get { return _customProperties;}
		}


		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderDelivery' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderDelivery
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrderDelivery")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity, 0, null, null, null, "IssuingOrderDelivery", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderOnWayTrack' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderOnWayTrack
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrderOnWayTrack")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackEntity, 0, null, null, null, "IssuingOrderOnWayTrack", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderReceiptInfoTrack' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderReceiptInfoTrack
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrderReceiptInfoTrack")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity, 0, null, null, null, "IssuingOrderReceiptInfoTrack", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderVehicleInfo' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderVehicleInfo
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrderVehicleInfo")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderVehicleInfoEntity, 0, null, null, null, "IssuingOrderVehicleInfo", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'MachineAccountIncome' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathMachineAccountIncome
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection(),
					(IEntityRelation)GetRelationsForField("MachineAccountIncome")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.MachineAccountIncomeEntity, 0, null, null, null, "MachineAccountIncome", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'MachineAccountPayment' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathMachineAccountPayment
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection(),
					(IEntityRelation)GetRelationsForField("MachineAccountPayment")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.MachineAccountPaymentEntity, 0, null, null, null, "MachineAccountPayment", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'RevenueMachineAccount' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathRevenueMachineAccount
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection(),
					(IEntityRelation)GetRelationsForField("RevenueMachineAccount")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.RevenueMachineAccountEntity, 0, null, null, null, "RevenueMachineAccount", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderDelivery' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack
		{
			get
			{
				IEntityRelation intermediateRelation = IssuingOrderEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderId;
				intermediateRelation.SetAliases(string.Empty, "IssuingOrderReceiptInfoTrack_");
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection(), intermediateRelation,
					(int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity, 0, null, null, GetRelationsForField("IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack"), "IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'VehicleModel' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathVehicleModelCollectionViaIssuingOrderVehicleInfo
		{
			get
			{
				IEntityRelation intermediateRelation = IssuingOrderEntity.Relations.IssuingOrderVehicleInfoEntityUsingIssuingOrderId;
				intermediateRelation.SetAliases(string.Empty, "IssuingOrderVehicleInfo_");
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.VehicleModelCollection(), intermediateRelation,
					(int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.VehicleModelEntity, 0, null, null, GetRelationsForField("VehicleModelCollectionViaIssuingOrderVehicleInfo"), "VehicleModelCollectionViaIssuingOrderVehicleInfo", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'CustomerInfo' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathCustomerInfo
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.CustomerInfoCollection(),
					(IEntityRelation)GetRelationsForField("CustomerInfo")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, (int)NetDon.OA.Data.EntityType.CustomerInfoEntity, 0, null, null, null, "CustomerInfo", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne);
			}
		}


		/// <summary>Returns the full name for this entity, which is important for the DAO to find back persistence info for this entity.</summary>
		[Browsable(false), XmlIgnore]
		public override string LLBLGenProEntityName
		{
			get { return "IssuingOrderEntity";}
		}

		/// <summary> The custom properties for the type of this entity instance.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		public override Dictionary<string, string> CustomPropertiesOfType
		{
			get { return IssuingOrderEntity.CustomProperties;}
		}

		/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
		{
			get { return _fieldsCustomProperties;}
		}

		/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		public override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
		{
			get { return IssuingOrderEntity.FieldsCustomProperties;}
		}

		/// <summary> The Id property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."Id"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
		public virtual System.Guid Id
		{
			get { return (System.Guid)GetValue((int)IssuingOrderFieldIndex.Id, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.Id, value, true); }
		}
		/// <summary> The BusinessType property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."BusinessType"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 BusinessType
		{
			get { return (System.Int32)GetValue((int)IssuingOrderFieldIndex.BusinessType, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.BusinessType, value, true); }
		}
		/// <summary> The OrderCode property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderCode"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String OrderCode
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.OrderCode, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderCode, value, true); }
		}
		/// <summary> The GoodsShippedTypeId property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."GoodsShippedTypeId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Guid GoodsShippedTypeId
		{
			get { return (System.Guid)GetValue((int)IssuingOrderFieldIndex.GoodsShippedTypeId, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.GoodsShippedTypeId, value, true); }
		}
		/// <summary> The RouteTypeId property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."RouteTypeId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Guid RouteTypeId
		{
			get { return (System.Guid)GetValue((int)IssuingOrderFieldIndex.RouteTypeId, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.RouteTypeId, value, true); }
		}
		/// <summary> The ReceivingOrderDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ReceivingOrderDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.DateTime ReceivingOrderDate
		{
			get { return (System.DateTime)GetValue((int)IssuingOrderFieldIndex.ReceivingOrderDate, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ReceivingOrderDate, value, true); }
		}
		/// <summary> The CustomerId property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."CustomerId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> CustomerId
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.CustomerId, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.CustomerId, value, true); }
		}
		/// <summary> The OrderVehicleNumber property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderVehicleNumber"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 OrderVehicleNumber
		{
			get { return (System.Int32)GetValue((int)IssuingOrderFieldIndex.OrderVehicleNumber, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderVehicleNumber, value, true); }
		}
		/// <summary> The TransportationPlanCode property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."TransportationPlanCode"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String TransportationPlanCode
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.TransportationPlanCode, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.TransportationPlanCode, value, true); }
		}
		/// <summary> The DeliveryProvince property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."DeliveryProvince"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 6<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String DeliveryProvince
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.DeliveryProvince, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.DeliveryProvince, value, true); }
		}
		/// <summary> The OrderVolumn property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderVolumn"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderVolumn
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderFieldIndex.OrderVolumn, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderVolumn, value, true); }
		}
		/// <summary> The OrderWeight property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderWeight"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderWeight
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderFieldIndex.OrderWeight, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderWeight, value, true); }
		}
		/// <summary> The OrderQuantity property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderQuantity"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderQuantity
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderFieldIndex.OrderQuantity, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderQuantity, value, true); }
		}
		/// <summary> The CheckoutType property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."CheckoutType"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 CheckoutType
		{
			get { return (System.Int32)GetValue((int)IssuingOrderFieldIndex.CheckoutType, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.CheckoutType, value, true); }
		}
		/// <summary> The EntruckingDetails property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."EntruckingDetails"<br/>
		/// Table field type characteristics (type, precision, scale, length): NText, 0, 0, 1073741823<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String EntruckingDetails
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.EntruckingDetails, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.EntruckingDetails, value, true); }
		}
		/// <summary> The EntruckingAddress property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."EntruckingAddress"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> EntruckingAddress
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.EntruckingAddress, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.EntruckingAddress, value, true); }
		}
		/// <summary> The PlannedShippingDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."PlannedShippingDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> PlannedShippingDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderFieldIndex.PlannedShippingDate, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.PlannedShippingDate, value, true); }
		}
		/// <summary> The ActualShippingDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ActualShippingDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> ActualShippingDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderFieldIndex.ActualShippingDate, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ActualShippingDate, value, true); }
		}
		/// <summary> The DelayedReasons property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."DelayedReasons"<br/>
		/// Table field type characteristics (type, precision, scale, length): NText, 0, 0, 1073741823<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String DelayedReasons
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.DelayedReasons, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.DelayedReasons, value, true); }
		}
		/// <summary> The ShuntingCost property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ShuntingCost"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Decimal ShuntingCost
		{
			get { return (System.Decimal)GetValue((int)IssuingOrderFieldIndex.ShuntingCost, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ShuntingCost, value, true); }
		}
		/// <summary> The ShuntingPerson property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ShuntingPerson"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> ShuntingPerson
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.ShuntingPerson, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ShuntingPerson, value, true); }
		}
		/// <summary> The PaymentMethod property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."PaymentMethod"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> PaymentMethod
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.PaymentMethod, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.PaymentMethod, value, true); }
		}
		/// <summary> The OnsiteOperator property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OnsiteOperator"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> OnsiteOperator
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.OnsiteOperator, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OnsiteOperator, value, true); }
		}
		/// <summary> The ActualEntruckingBoxAmount property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ActualEntruckingBoxAmount"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 ActualEntruckingBoxAmount
		{
			get { return (System.Int32)GetValue((int)IssuingOrderFieldIndex.ActualEntruckingBoxAmount, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ActualEntruckingBoxAmount, value, true); }
		}
		/// <summary> The GoodsJiltedReasons property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."GoodsJiltedReasons"<br/>
		/// Table field type characteristics (type, precision, scale, length): NText, 0, 0, 1073741823<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String GoodsJiltedReasons
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.GoodsJiltedReasons, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.GoodsJiltedReasons, value, true); }
		}
		/// <summary> The IsGoodsJilted property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."IsGoodsJilted"<br/>
		/// Table field type characteristics (type, precision, scale, length): Bit, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Boolean IsGoodsJilted
		{
			get { return (System.Boolean)GetValue((int)IssuingOrderFieldIndex.IsGoodsJilted, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.IsGoodsJilted, value, true); }
		}
		/// <summary> The OnsiteEntruckingComments property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OnsiteEntruckingComments"<br/>
		/// Table field type characteristics (type, precision, scale, length): NText, 0, 0, 1073741823<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String OnsiteEntruckingComments
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.OnsiteEntruckingComments, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OnsiteEntruckingComments, value, true); }
		}
		/// <summary> The CreatedDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."CreatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> CreatedDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderFieldIndex.CreatedDate, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.CreatedDate, value, true); }
		}
		/// <summary> The LastUpdatedDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."LastUpdatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> LastUpdatedDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderFieldIndex.LastUpdatedDate, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.LastUpdatedDate, value, true); }
		}
		/// <summary> The CreateBy property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."CreateBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> CreateBy
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.CreateBy, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.CreateBy, value, true); }
		}
		/// <summary> The LastUpdatedBy property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."LastUpdatedBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> LastUpdatedBy
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderFieldIndex.LastUpdatedBy, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.LastUpdatedBy, value, true); }
		}
		/// <summary> The OrderStatus property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."OrderStatus"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Int32 OrderStatus
		{
			get { return (System.Int32)GetValue((int)IssuingOrderFieldIndex.OrderStatus, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.OrderStatus, value, true); }
		}
		/// <summary> The AreaId property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."AreaId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Guid AreaId
		{
			get { return (System.Guid)GetValue((int)IssuingOrderFieldIndex.AreaId, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.AreaId, value, true); }
		}
		/// <summary> The ShuntingCostExceptionsComment property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ShuntingCostExceptionsComment"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 2147483647<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String ShuntingCostExceptionsComment
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.ShuntingCostExceptionsComment, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ShuntingCostExceptionsComment, value, true); }
		}
		/// <summary> The StartShippmentDate property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."StartShippmentDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> StartShippmentDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderFieldIndex.StartShippmentDate, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.StartShippmentDate, value, true); }
		}
		/// <summary> The ShuntingCostExceptionComments property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ShuntingCostExceptionComments"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 2147483647<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String ShuntingCostExceptionComments
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.ShuntingCostExceptionComments, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ShuntingCostExceptionComments, value, true); }
		}
		/// <summary> The GoodsLeftBoxAmount property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."GoodsLeftBoxAmount"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Int32> GoodsLeftBoxAmount
		{
			get { return (Nullable<System.Int32>)GetValue((int)IssuingOrderFieldIndex.GoodsLeftBoxAmount, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.GoodsLeftBoxAmount, value, true); }
		}
		/// <summary> The DelayedDays property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."DelayedDays"<br/>
		/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Int32> DelayedDays
		{
			get { return (Nullable<System.Int32>)GetValue((int)IssuingOrderFieldIndex.DelayedDays, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.DelayedDays, value, true); }
		}
		/// <summary> The GoodsUnloadingCost property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."GoodsUnloadingCost"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> GoodsUnloadingCost
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderFieldIndex.GoodsUnloadingCost, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.GoodsUnloadingCost, value, true); }
		}
		/// <summary> The IsClientReturnVisit property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."IsClientReturnVisit"<br/>
		/// Table field type characteristics (type, precision, scale, length): Bit, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Boolean> IsClientReturnVisit
		{
			get { return (Nullable<System.Boolean>)GetValue((int)IssuingOrderFieldIndex.IsClientReturnVisit, false); }
			set	{ SetValue((int)IssuingOrderFieldIndex.IsClientReturnVisit, value, true); }
		}
		/// <summary> The ClientTelephone property of the Entity IssuingOrder<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrder"."ClientTelephone"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String ClientTelephone
		{
			get { return (System.String)GetValue((int)IssuingOrderFieldIndex.ClientTelephone, true); }
			set	{ SetValue((int)IssuingOrderFieldIndex.ClientTelephone, value, true); }
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderDelivery()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection IssuingOrderDelivery
		{
			get	{ return GetMultiIssuingOrderDelivery(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderDelivery. When set to true, IssuingOrderDelivery is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderDelivery is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderDelivery(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderDelivery
		{
			get	{ return _alwaysFetchIssuingOrderDelivery; }
			set	{ _alwaysFetchIssuingOrderDelivery = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderDelivery already has been fetched. Setting this property to false when IssuingOrderDelivery has been fetched
		/// will clear the IssuingOrderDelivery collection well. Setting this property to true while IssuingOrderDelivery hasn't been fetched disables lazy loading for IssuingOrderDelivery</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderDelivery
		{
			get { return _alreadyFetchedIssuingOrderDelivery;}
			set 
			{
				if(_alreadyFetchedIssuingOrderDelivery && !value && (_issuingOrderDelivery != null))
				{
					_issuingOrderDelivery.Clear();
				}
				_alreadyFetchedIssuingOrderDelivery = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'IssuingOrderOnWayTrackEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderOnWayTrack()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderOnWayTrackCollection IssuingOrderOnWayTrack
		{
			get	{ return GetMultiIssuingOrderOnWayTrack(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderOnWayTrack. When set to true, IssuingOrderOnWayTrack is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderOnWayTrack is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderOnWayTrack(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderOnWayTrack
		{
			get	{ return _alwaysFetchIssuingOrderOnWayTrack; }
			set	{ _alwaysFetchIssuingOrderOnWayTrack = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderOnWayTrack already has been fetched. Setting this property to false when IssuingOrderOnWayTrack has been fetched
		/// will clear the IssuingOrderOnWayTrack collection well. Setting this property to true while IssuingOrderOnWayTrack hasn't been fetched disables lazy loading for IssuingOrderOnWayTrack</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderOnWayTrack
		{
			get { return _alreadyFetchedIssuingOrderOnWayTrack;}
			set 
			{
				if(_alreadyFetchedIssuingOrderOnWayTrack && !value && (_issuingOrderOnWayTrack != null))
				{
					_issuingOrderOnWayTrack.Clear();
				}
				_alreadyFetchedIssuingOrderOnWayTrack = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderReceiptInfoTrack()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection IssuingOrderReceiptInfoTrack
		{
			get	{ return GetMultiIssuingOrderReceiptInfoTrack(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderReceiptInfoTrack. When set to true, IssuingOrderReceiptInfoTrack is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderReceiptInfoTrack is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderReceiptInfoTrack(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderReceiptInfoTrack
		{
			get	{ return _alwaysFetchIssuingOrderReceiptInfoTrack; }
			set	{ _alwaysFetchIssuingOrderReceiptInfoTrack = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderReceiptInfoTrack already has been fetched. Setting this property to false when IssuingOrderReceiptInfoTrack has been fetched
		/// will clear the IssuingOrderReceiptInfoTrack collection well. Setting this property to true while IssuingOrderReceiptInfoTrack hasn't been fetched disables lazy loading for IssuingOrderReceiptInfoTrack</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderReceiptInfoTrack
		{
			get { return _alreadyFetchedIssuingOrderReceiptInfoTrack;}
			set 
			{
				if(_alreadyFetchedIssuingOrderReceiptInfoTrack && !value && (_issuingOrderReceiptInfoTrack != null))
				{
					_issuingOrderReceiptInfoTrack.Clear();
				}
				_alreadyFetchedIssuingOrderReceiptInfoTrack = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'IssuingOrderVehicleInfoEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderVehicleInfo()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderVehicleInfoCollection IssuingOrderVehicleInfo
		{
			get	{ return GetMultiIssuingOrderVehicleInfo(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderVehicleInfo. When set to true, IssuingOrderVehicleInfo is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderVehicleInfo is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderVehicleInfo(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderVehicleInfo
		{
			get	{ return _alwaysFetchIssuingOrderVehicleInfo; }
			set	{ _alwaysFetchIssuingOrderVehicleInfo = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderVehicleInfo already has been fetched. Setting this property to false when IssuingOrderVehicleInfo has been fetched
		/// will clear the IssuingOrderVehicleInfo collection well. Setting this property to true while IssuingOrderVehicleInfo hasn't been fetched disables lazy loading for IssuingOrderVehicleInfo</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderVehicleInfo
		{
			get { return _alreadyFetchedIssuingOrderVehicleInfo;}
			set 
			{
				if(_alreadyFetchedIssuingOrderVehicleInfo && !value && (_issuingOrderVehicleInfo != null))
				{
					_issuingOrderVehicleInfo.Clear();
				}
				_alreadyFetchedIssuingOrderVehicleInfo = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'MachineAccountIncomeEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiMachineAccountIncome()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.MachineAccountIncomeCollection MachineAccountIncome
		{
			get	{ return GetMultiMachineAccountIncome(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for MachineAccountIncome. When set to true, MachineAccountIncome is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time MachineAccountIncome is accessed. You can always execute
		/// a forced fetch by calling GetMultiMachineAccountIncome(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchMachineAccountIncome
		{
			get	{ return _alwaysFetchMachineAccountIncome; }
			set	{ _alwaysFetchMachineAccountIncome = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property MachineAccountIncome already has been fetched. Setting this property to false when MachineAccountIncome has been fetched
		/// will clear the MachineAccountIncome collection well. Setting this property to true while MachineAccountIncome hasn't been fetched disables lazy loading for MachineAccountIncome</summary>
		[Browsable(false)]
		public bool AlreadyFetchedMachineAccountIncome
		{
			get { return _alreadyFetchedMachineAccountIncome;}
			set 
			{
				if(_alreadyFetchedMachineAccountIncome && !value && (_machineAccountIncome != null))
				{
					_machineAccountIncome.Clear();
				}
				_alreadyFetchedMachineAccountIncome = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'MachineAccountPaymentEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiMachineAccountPayment()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.MachineAccountPaymentCollection MachineAccountPayment
		{
			get	{ return GetMultiMachineAccountPayment(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for MachineAccountPayment. When set to true, MachineAccountPayment is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time MachineAccountPayment is accessed. You can always execute
		/// a forced fetch by calling GetMultiMachineAccountPayment(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchMachineAccountPayment
		{
			get	{ return _alwaysFetchMachineAccountPayment; }
			set	{ _alwaysFetchMachineAccountPayment = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property MachineAccountPayment already has been fetched. Setting this property to false when MachineAccountPayment has been fetched
		/// will clear the MachineAccountPayment collection well. Setting this property to true while MachineAccountPayment hasn't been fetched disables lazy loading for MachineAccountPayment</summary>
		[Browsable(false)]
		public bool AlreadyFetchedMachineAccountPayment
		{
			get { return _alreadyFetchedMachineAccountPayment;}
			set 
			{
				if(_alreadyFetchedMachineAccountPayment && !value && (_machineAccountPayment != null))
				{
					_machineAccountPayment.Clear();
				}
				_alreadyFetchedMachineAccountPayment = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'RevenueMachineAccountEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiRevenueMachineAccount()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.RevenueMachineAccountCollection RevenueMachineAccount
		{
			get	{ return GetMultiRevenueMachineAccount(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for RevenueMachineAccount. When set to true, RevenueMachineAccount is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time RevenueMachineAccount is accessed. You can always execute
		/// a forced fetch by calling GetMultiRevenueMachineAccount(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchRevenueMachineAccount
		{
			get	{ return _alwaysFetchRevenueMachineAccount; }
			set	{ _alwaysFetchRevenueMachineAccount = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property RevenueMachineAccount already has been fetched. Setting this property to false when RevenueMachineAccount has been fetched
		/// will clear the RevenueMachineAccount collection well. Setting this property to true while RevenueMachineAccount hasn't been fetched disables lazy loading for RevenueMachineAccount</summary>
		[Browsable(false)]
		public bool AlreadyFetchedRevenueMachineAccount
		{
			get { return _alreadyFetchedRevenueMachineAccount;}
			set 
			{
				if(_alreadyFetchedRevenueMachineAccount && !value && (_revenueMachineAccount != null))
				{
					_revenueMachineAccount.Clear();
				}
				_alreadyFetchedRevenueMachineAccount = value;
			}
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderDeliveryEntity' using a relation of type 'm:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderDeliveryCollection IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack
		{
			get { return GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack. When set to true, IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack
		{
			get	{ return _alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack; }
			set	{ _alwaysFetchIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = value; }
		}
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack already has been fetched. Setting this property to false when IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack has been fetched
		/// will clear the IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack collection well. Setting this property to true while IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack hasn't been fetched disables lazy loading for IssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack
		{
			get { return _alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack;}
			set 
			{
				if(_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack && !value && (_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack != null))
				{
					_issuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack.Clear();
				}
				_alreadyFetchedIssuingOrderDeliveryCollectionViaIssuingOrderReceiptInfoTrack = value;
			}
		}
		/// <summary> Retrieves all related entities of type 'VehicleModelEntity' using a relation of type 'm:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.VehicleModelCollection VehicleModelCollectionViaIssuingOrderVehicleInfo
		{
			get { return GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for VehicleModelCollectionViaIssuingOrderVehicleInfo. When set to true, VehicleModelCollectionViaIssuingOrderVehicleInfo is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time VehicleModelCollectionViaIssuingOrderVehicleInfo is accessed. You can always execute
		/// a forced fetch by calling GetMultiVehicleModelCollectionViaIssuingOrderVehicleInfo(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo
		{
			get	{ return _alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo; }
			set	{ _alwaysFetchVehicleModelCollectionViaIssuingOrderVehicleInfo = value; }
		}
				
		/// <summary>Gets / Sets the lazy loading flag if the property VehicleModelCollectionViaIssuingOrderVehicleInfo already has been fetched. Setting this property to false when VehicleModelCollectionViaIssuingOrderVehicleInfo has been fetched
		/// will clear the VehicleModelCollectionViaIssuingOrderVehicleInfo collection well. Setting this property to true while VehicleModelCollectionViaIssuingOrderVehicleInfo hasn't been fetched disables lazy loading for VehicleModelCollectionViaIssuingOrderVehicleInfo</summary>
		[Browsable(false)]
		public bool AlreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo
		{
			get { return _alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo;}
			set 
			{
				if(_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo && !value && (_vehicleModelCollectionViaIssuingOrderVehicleInfo != null))
				{
					_vehicleModelCollectionViaIssuingOrderVehicleInfo.Clear();
				}
				_alreadyFetchedVehicleModelCollectionViaIssuingOrderVehicleInfo = value;
			}
		}

		/// <summary> Gets / sets related entity of type 'CustomerInfoEntity'. This property is not visible in databound grids.
		/// Setting this property to a new object will make the load-on-demand feature to stop fetching data from the database, until you set this
		/// property to null. Setting this property to an entity will make sure that FK-PK relations are synchronized when appropriate.</summary>
		/// <remarks>This property is added for conveniance, however it is recommeded to use the method 'GetSingleCustomerInfo()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the
		/// same scope. The property is marked non-browsable to make it hidden in bound controls, f.e. datagrids.</remarks>
		[Browsable(false)]
		public virtual CustomerInfoEntity CustomerInfo
		{
			get	{ return GetSingleCustomerInfo(false); }
			set
			{
				if(base.IsDeserializing)
				{
					SetupSyncCustomerInfo(value);
				}
				else
				{
					if(value==null)
					{
						if(_customerInfo != null)
						{
							_customerInfo.UnsetRelatedEntity(this, "IssuingOrder");
						}
					}
					else
					{
						if(_customerInfo!=value)
						{
							((IEntity)value).SetRelatedEntity(this, "IssuingOrder");
						}
					}
				}
			}
		}

		/// <summary> Gets / sets the lazy loading flag for CustomerInfo. When set to true, CustomerInfo is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time CustomerInfo is accessed. You can always execute
		/// a forced fetch by calling GetSingleCustomerInfo(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchCustomerInfo
		{
			get	{ return _alwaysFetchCustomerInfo; }
			set	{ _alwaysFetchCustomerInfo = value; }	
		}
				
		/// <summary>Gets / Sets the lazy loading flag if the property CustomerInfo already has been fetched. Setting this property to false when CustomerInfo has been fetched
		/// will set CustomerInfo to null as well. Setting this property to true while CustomerInfo hasn't been fetched disables lazy loading for CustomerInfo</summary>
		[Browsable(false)]
		public bool AlreadyFetchedCustomerInfo
		{
			get { return _alreadyFetchedCustomerInfo;}
			set 
			{
				if(_alreadyFetchedCustomerInfo && !value)
				{
					this.CustomerInfo = null;
				}
				_alreadyFetchedCustomerInfo = value;
			}
		}

		/// <summary> Gets / sets the flag for what to do if the related entity available through the property CustomerInfo is not found
		/// in the database. When set to true, CustomerInfo will return a new entity instance if the related entity is not found, otherwise 
		/// null be returned if the related entity is not found. Default: true.</summary>
		[Browsable(false)]
		public bool CustomerInfoReturnsNewIfNotFound
		{
			get	{ return _customerInfoReturnsNewIfNotFound; }
			set { _customerInfoReturnsNewIfNotFound = value; }	
		}



		/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
		protected override bool LLBLGenProIsSubType
		{
			get { return false;}
		}

		/// <summary> Gets the type of the hierarchy this entity is in. </summary>
		[System.ComponentModel.Browsable(false), XmlIgnore]
		protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
		{
			get { return InheritanceHierarchyType.None;}
		}
		
		/// <summary>Returns the NetDon.OA.Data.EntityType enum value for this entity.</summary>
		[Browsable(false), XmlIgnore]
		public override int LLBLGenProEntityTypeValue 
		{ 
			get { return (int)NetDon.OA.Data.EntityType.IssuingOrderEntity; }
		}
		#endregion


		#region Custom Entity code
		
		// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Included code

		#endregion
	}
}
